package com.nwpu.coursesupport.mapper;


import com.nwpu.coursesupport.entity.FinalExamTaskCourseTargetEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author shun
 * @email ws2017303035@mail.nwpu.edu.cn
 * @date 2020-08-04 21:33:50
 */
@Mapper
public interface FinalExamTaskCourseTargetDao {
    @Insert("insert into final_exam_task_course_target values (null,#{finalExamTaskId},#{courseTargetId},#{weight},#{fullMark},#{actualMark})")
    @Options(keyProperty = "id", keyColumn = "id", useGeneratedKeys = true)
    Integer save(FinalExamTaskCourseTargetEntity finalExamTaskCourseTargetEntity);

    @Select("select * from final_exam_task_course_target where final_exam_task_id=#{id}")
    List<FinalExamTaskCourseTargetEntity> findByFinalExamTaskId(@Param("id") Integer id);

    @Delete("delete from final_exam_task_course_target where id=#{id}")
    void deleteById(@Param("id")Integer id);
}
